import { CHANGE_LOGIN } from './constants'

const changeLogin = (isLogin) => ({ type: CHANGE_LOGIN, isLogin })


export const doLogin = () => dispatch => {
    return new Promise((resolve)=>{
        setTimeout(()=>{
            dispatch(changeLogin(true))
            resolve(true);
        },1000)
    })
}

export const logOut = () => dispatch => {
    return new Promise((resolve)=>{
        setTimeout(()=>{
            dispatch(changeLogin(false))
            resolve(false);
        },1000)
    })
}